package com.boco.blch.analysiser.compliance.HW.manager;

import com.boco.blch.analysiser.compliance.ComplianceResolved;
import com.boco.blch.analysiser.util.XmlUtil;

public class BOCO_Hive_HAManage_MasterSlave implements ComplianceResolved{

	private final static String EXPECT_RESULT = "";
	private final static String EXPECT_RESULT1 = "true";
	private static final String TAG_NAME = "hive.zookeeper.quorum";
	private static final String TAG_NAME1 = "hive.server2.support.dynamic.service.discovery";
	private static final String TAG_NAME2 = "hive.server2.zookeeper.namespace";
	@Override
	public int realEchoResolved(String echoResult) {
		if(echoResult != null && echoResult.trim().length() > 0){
			String result = XmlUtil.getValueByName(echoResult, TAG_NAME);
			String result1 = XmlUtil.getValueByName(echoResult, TAG_NAME1);
			String result2 = XmlUtil.getValueByName(echoResult, TAG_NAME2);
			if(!EXPECT_RESULT.equalsIgnoreCase(result)&&EXPECT_RESULT1.equalsIgnoreCase(result1)&&
					!EXPECT_RESULT.equalsIgnoreCase(result2))
				return SUCCESS;
		}
		return FAILED;
	}

}
